package web;

import javax.servlet.http.HttpServlet;

import orm.dao.ConnectionPool;
import service.BOService;
import service.ORMService;
import tools.PropertyReader;

public class DBInitializationServlet extends HttpServlet {

	public void init() {
		try {
			int connectionPoolSize = Integer.parseInt(PropertyReader.getProperty("db.properties", "connectionPoolSize"));
			ConnectionPool pool = ConnectionPool.getInstance(new int[] { connectionPoolSize });
			ORMService ormService = ORMService.getInstance();
			BOService boService = BOService.getInstance();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void destroy() {
		try {
			ConnectionPool pool = ConnectionPool.getInstance(new int[0]);
			pool.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}